<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
    <style>
        #form {
            padding-right: 100px;
            margin-top: 300px;
            width: 40%;
        }

        #image {
            padding-left: 100px;
            padding-top: 100px;
        }

        a:link {
            text-decoration: none;
            color: black;
        }
    </style>
</head>
<body background="img/background.jpg">
<div class="row">
    <img class="col-md-6" id="image" src="img/pregnant.svg"/>
    <div background-color="width" class="col-md-6" id="form">
        <div class="form-group">
            <label for="exampleInputEmail1">患者ID</label>
            <input class="form-control" id="ID" placeholder="text" required="required" type="text"/>
        </div>
        <div class="form-group">
            <label for="exampleInputEmail1">患者姓名</label>
            <input class="form-control" id="patientName" placeholder="text" required="required" type="text"/>
        </div>
        <div>
            <button class="btn btn-default" onclick="window.location.href='/'" type="submit">返回</button>
            <button class="btn btn-default" id="submit" onclick="return false;" type="submit">提交</button>
        </div>

    </div>
</div>

<script>
    function createDate() {
        var Date = new Object;
        Date.ID = null;
        Date.patientName = null;
        Date.phone = null;
        Date.doctorName = null;
        Date.date = null;
        return Date;
    }

    var Date = createDate();

    $(document).ready(function () {
        $("#submit").click(function () {
            Date.ID = $("#ID").val();
            Date.patientName = $("#patientName").val();
            $.post("/deleteDate",
                Date,
                function (data, status) {
                    if (status == "success") {
                        alert("删除成功\n" + "请放回查询预约页面进行查询！");
                    }
                });
        });
    });

</script>
</body>
</html>